package com.common.base.widget

import android.graphics.Outline
import android.graphics.Rect
import android.view.View
import android.view.ViewOutlineProvider

class RoundViewOutlineProvider(private var radius: Float) : ViewOutlineProvider() {
        override fun getOutline(view: View?, outline: Outline?) {
            view?.let {
                val selfRect = Rect(0, 0, it.width, it.height)
                outline?.setRoundRect(selfRect, radius)
            }
        }
    }